import { Injectable } from '@angular/core';
import {SimpleJsonFormatter, SimplePipe} from '../../../ng-tools';
import {DatePipe} from '@angular/common';
import {StatusPipe} from '../../../ng-tools/src/components/badge/status.pipe';

@Injectable({
  providedIn: 'root'
})
export class UserAccountDetailService {
  type: SimpleJsonFormatter = {propName: 'type', displayName: '类别'};
  account: SimpleJsonFormatter = {propName: 'account', displayName: '金额'};
  createDate: SimpleJsonFormatter = {propName: 'createDate', displayName: '时间'};
  constructor(private statusPipe: StatusPipe, private datePipe: DatePipe) {
    this.type.pipe = new SimplePipe(this.statusPipe, [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17],
      ['充值', '提现', '发红包', '中雷赔付', '抢红包', '赔付', '红包过期退还', '返利', '红包奖励', '活动支出', '牛牛赔付', '牛牛赢钱', '接龙赔付', '牛牛发包押金', '牛牛押金退回', '扫雷赢钱', '接龙赢钱']]);
    this.createDate.pipe = new SimplePipe(this.datePipe, ['yyyy-MM-dd HH:mm:ss', null, null, null]);
  }
  get formatter() {
    return [
        this.type,
        this.account,
        this.createDate
    ];
  }

}
